/**
 * 合并多个reducers
  
 */


function combineReducers(reducers) {
    return function (state = {}, action) {
        let nextState = {}
        for (let key in reducers) { // 将单个reducer执行结果赋值为nextState上某个属性
            nextState[key] = reducers[key](state[key], action)
        }
        return nextState
    }
}

/***
 * 最终的返回值
 * state={
 *  counter1:{number:1}
 *  counter2: {number:1}
 * }
 */

export default combineReducers